package com.ifcar.app.activity.tab;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.drawable.BitmapDrawable;
import android.os.Bundle;
import android.os.Message;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.AdapterView.OnItemClickListener;

import com.ifcar.app.activity.NewsPage;
import com.ifcar.app.activity.R;
import com.ifcar.app.activity.SpecialAritcleTwo;
import com.ifcar.app.activity.news.NewsListFragment;
import com.ifcar.app.activity.newspage.NewsFragment;
import com.ifcar.app.db.NewsSQLiteOpenHelper;
import com.ifcar.app.fragment.NRAbsPullLoadingListFrament;
import com.ifcar.app.model.News;
import com.ifcar.app.rss.GetColumnsInfo;
import com.ifcar.app.util.BaseImageDownloader;
import com.ifcar.app.util.BasePageViewAdapter;
import com.ifcar.app.util.ModelUtils;
import com.ifcar.app.util.PicUtil;
import com.ifcar.app.util.StringUtil;
import com.ifcar.app.util.ThemeSettingsHelper;
import com.ifcar.app.util.Tools;
import com.ifcar.app.view.LoadingListView;

public class HomeFragment extends HomeListFragment { 
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
        return inflater.inflate(R.layout.pull_load_list_layout, container, false);
    }

    @Override
    public void onViewCreatedNR(View view, Bundle savedInstanceState) {
        super.onViewCreatedNR(view, savedInstanceState);

        LoadingListView loadingListView = (LoadingListView) view
                .findViewById(R.id.loading_list);

        LayoutInflater inflate = LayoutInflater.from(getActivity());
        View moreView = inflate.inflate(R.layout.more_layout,
                loadingListView.getListView(), false);
        loadingListView.setLoadingMoreView(moreView, R.id.show_more_button);

        attachLoadingListView(loadingListView);
    }

    @Override
    public void onApplyTheme() {
        super.onApplyTheme();
        ThemeSettingsHelper themeSettingsHelper = getThemeSettingsHelper();
        Context context = getActivity();
        LoadingListView loadingListView = getLoadingListView();
        themeSettingsHelper.setListViewDivider(context,
                loadingListView.getListView(), R.drawable.list_divider_line);
        Button moreButton = (Button) loadingListView.getLoadingMoreClickView();
        if (moreButton != null) {
            themeSettingsHelper.setViewBackgroud(context, moreButton,
                    R.drawable.netease_big_button);
            themeSettingsHelper.setTextViewColor(context, moreButton,
                    R.color.list_title_color);
        }
    }
    
    @Override
    public void onTabSelected(boolean first) {
        super.onTabSelected(first);

        
        
    }

}
